import VueRouter from "vue-router";
import About from '../pages/About'
import Home from '../pages/Home'
import News from '../pages/News'
import Message from '../pages/Message'
import Detail from '../pages/Detail'
export default new VueRouter({
    routes: [{
        name: 'guanyu',
        path: '/about',
        component: About
    },
    {
        name: 'zhuye',
        path: '/home',
        component: Home,
        children: [{
            name: 'xinwen',
            path: 'news',
            component: News
        },
        {
            name: 'xiaoxi',
            path: 'message',
            component: Message,
            children: [{
                name: 'xiangqing',
                // path:'detail',
                path: 'detail/:id/:title',
                component: Detail,
                props({
                    params
                }) {
                    return {
                        id: params.id,
                        title: params.title
                    }
                }
            }]
        }
        ]
    },

    ]
})